package fun.tan90.easy.binlog.manager.service;

import fun.tan90.easy.binlog.manager.model.BinlogWorkInstance;

import java.util.List;
import java.util.Map;

/**
 * description TODO
 * company 铁人科技
 *
 * @author 陈浩杰
 * @date 2023/9/9 10:50
 */
public interface BinlogWorkerService {

    /**
     * 获取所有在线工作节点信息
     *
     * @return
     */
    List<BinlogWorkInstance> onlineWorkers();

    /**
     * 向worker广播消息
     *
     * @param event
     * @param content
     * @param metaMap
     */
    void broadcastSend(String event, String content, Map<String, String> metaMap);

    /**
     * 向worker广播消息并获取结果
     *
     * @param event
     * @param content
     * @param metaMap
     */
    Map<String, String> broadcastSendAndRequest(String event, String content, Map<String, String> metaMap);
}
